home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / CPP / WCLASS95.ZIP / ST2MAIN.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-25  |  1.7 KB  |  62 lines

  1. #include "controll.h"
  2. #include <iostream.h>
  3. #include <cstring.h>
  4.  
  5. int main ()
  6. {
  7. /* 
  8.   //Use with ST2STATE.OMT and ST2HEAD1.SCT, ST2FUNC1.SCT, ST2HEAD2.SCT, and ST2FUNC2.SCT        
  9.   Controller controller1;
  10.   try {
  11.          controller1.process (turnOn);}
  12.   catch (string eventError) { cout << eventError << "Cannot process event" << endl; }
  13.  
  14.   try {
  15.          controller1.process (turnOff); }
  16.   catch (string eventError) { cout << eventError << "Cannot process event" << endl; }
  17.   return 0;
  18. */
  19.  
  20.   //Use with ST2STATE.OMT and ST2HEAD3.SCT and ST2FUNC3.SCT, ST2HEAD5.SCT, ST2FUNC5.SCT 
  21.   Controller controller1;
  22.   try {
  23.          controller1.turnOn (1);  }
  24.   catch (string eventError) { cout << eventError << "Cannot process event" << endl; }
  25.  
  26.   try {
  27.          controller1.turnOff (); }
  28.   catch (string eventError) { cout << eventError << "Cannot process event" << endl; }
  29.  
  30.   return 0;
  31. /*
  32.   //Use with ST2STATE.OMT and ST2HEAD4.SCT and ST2FUNC4.SCT     
  33.   pOffState = new OffState();
  34.   pOnState = new OnState();
  35.   State *pCurrentState;
  36.   pCurrentState = pOffState;
  37.   
  38.   try {
  39.          pCurrentState = pCurrentState->turnOn(1); }
  40.   catch (string eventError) { cout << eventError << "Cannot process event" << endl; } 
  41.  
  42.   try {     
  43.          pCurrentState = pCurrentState->turnOff(); } 
  44.   catch (string eventError) { cout << eventError << "Cannot process event" << endl; }  
  45.  
  46.   return 0;
  47. */
  48. /*
  49.   //Use with ST2STATE.OMT and ST2HEAD5.SCT and ST2FUNC5.SCT     
  50.   Controller controller1;    
  51.   try {
  52.      controller1.turnOn(1); }
  53.   catch (string eventError) { cout << eventError << "Cannot process event" << endl; } 
  54.  
  55.   try {     
  56.      controller1.turnOff(); } 
  57.   catch (string eventError) { cout << eventError << "Cannot process event" << endl; }  
  58.  
  59.   return 0;
  60. */
  61. }
  62.